<template>

    <div id="List">
        <p>{{name}} || {{$store.state.list.name}} || {{getName}}</p>
        <button @click="setName">异步加载+</button>
    </div>
</template>

<script>
    import {mapState,mapGetters,mapActions,mapMutations} from 'vuex'
    export default {
        name: "List",

        computed:{
            ...mapState({
                name:'list/name'
            }),
            getName(){
                return this.$store.getters['list/getName']
            }

        },
        methods:{
            //...mapActions(['list/setName'])
            setName(){
                this.$store.dispatch("list/setName");
            }
        }
    }


</script>

<style scoped>

</style>